package io.github.frailty9.crserver.model

import java.time.LocalDateTime
import com.mybatisflex.annotation.Column
import com.mybatisflex.annotation.Id

/**
 * 用户信息表
 */
data class User(
    @Id
    override var id: Long? = null,
    /**
     * 学生学号/教师编号/...
     */
    var externalId: String? = null,
    /**
     * name
     */
    var name: String? = null,
    /**
     * 性别: 0=女, 1=男
     */
    var gender: Int? = null,
    /**
     * phone
     */
    var phone: String? = null,
    /**
     * email
     */
    var email: String? = null,
    /**
     * 二级学院
     */
    var college: String? = null,
    /**
     * 专业/部门
     */
    var major: String? = null,
    /**
     * student_class
     */
    var studentClass: String? = null,
    /**
     * grade
     */
    var grade: Int? = null,

    @Column(version = true)
    override var version: Int? = null,

    @Column(onInsertValue = "CURRENT_TIMESTAMP")
    var createTime: LocalDateTime? = null,

    @Column(onInsertValue = "CURRENT_TIMESTAMP", onUpdateValue = "CURRENT_TIMESTAMP")
    var updateTime: LocalDateTime? = null,

    @Column(isLogicDelete = true)
    override var deleted: Int? = null
) : BaseModel
